import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [

  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/user',
    children:[
      {path: '/user', component: () => import('../views/user/user.vue')},
      {path: '/vehicle', component: () => import('../views/vehicle/vehicle.vue')},
      {path: '/geofence', component: () => import('../views/geofence/geofence.vue')},
      {path: '/geofencemap', component: () => import('../views/geofence/geofencemap.vue')},
      {path: '/application', component: () => import('../views/schedule/application.vue')},
      {path: '/audit', component: () => import('../views/schedule/audit.vue')},
      {path: '/distribute', component: () => import('../views/schedule/distribute.vue')},
      {path: '/dict', component: () => import('../views/dictionary/dict.vue')},
      {path: '/dictoption', component: () => import('../views/dictionary/dictoption.vue')}
    ]
  },
  {path: '/login',component: () => import('../views/login.vue')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
